<?php

namespace Common\Bundle\LibraryBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;

/**
 * Question
 *
 * @ORM\Table("question")
 * @ORM\Entity(repositoryClass="Common\Bundle\LibraryBundle\Entity\Repository\QuestionRepository")
 */
class Question
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="libelle", type="string", length=255)
     * @Assert\NotBlank()
     */
    private $libelle;

    /**
     * @var string
     *
     * @ORM\Column(name="aide", type="text", nullable=true)
     */
    private $aide;

    /**
     * @var string
     *
     * @ORM\Column(name="complementReponse", type="text", nullable=true)
     */
    private $complementReponse;

    /**
     * @var integer
     *
     * @ORM\Column(name="ordre", type="integer", nullable=true)
     */
    private $ordre;

    /**
     * @var TypeQuestion
     *
     * @ORM\ManyToOne(targetEntity="\Common\Bundle\LibraryBundle\Entity\TypeQuestion", cascade={"persist"})
     */
    private $typeQuestion;

    /**
     * @var Qcm
     *
     * @ORM\ManyToOne(targetEntity="\Common\Bundle\LibraryBundle\Entity\Qcm", inversedBy="questions")
     */
    private $qcm;

    /**
     * @var Reponse
     *
     * @ORM\OneToMany(targetEntity="\Common\Bundle\LibraryBundle\Entity\Reponse", mappedBy="question", cascade={"persist", "remove"}, orphanRemoval=true)
     */
    private $reponses;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set libelle
     *
     * @param string $libelle
     * @return Question
     */
    public function setLibelle($libelle)
    {
        $this->libelle = $libelle;

        return $this;
    }

    /**
     * Get libelle
     *
     * @return string 
     */
    public function getLibelle()
    {
        return $this->libelle;
    }

    /**
     * Set aide
     *
     * @param string $aide
     * @return Question
     */
    public function setAide($aide)
    {
        $this->aide = $aide;

        return $this;
    }

    /**
     * Get aide
     *
     * @return string 
     */
    public function getAide()
    {
        return $this->aide;
    }

    /**
     * Set complementReponse
     *
     * @param string $complementReponse
     * @return Question
     */
    public function setComplementReponse($complementReponse)
    {
        $this->complementReponse = $complementReponse;

        return $this;
    }

    /**
     * Get complementReponse
     *
     * @return string 
     */
    public function getComplementReponse()
    {
        return $this->complementReponse;
    }

    /**
     * Set ordre
     *
     * @param integer $ordre
     * @return Question
     */
    public function setOrdre($ordre)
    {
        $this->ordre = $ordre;

        return $this;
    }

    /**
     * Get ordre
     *
     * @return integer 
     */
    public function getOrdre()
    {
        return $this->ordre;
    }

    /**
     * @param \Common\Bundle\LibraryBundle\Entity\TypeQuestion $typeQuestion
     */
    public function setTypeQuestion($typeQuestion)
    {
        $this->typeQuestion = $typeQuestion;
    }

    /**
     * @return \Common\Bundle\LibraryBundle\Entity\TypeQuestion
     */
    public function getTypeQuestion()
    {
        return $this->typeQuestion;
    }

    /**
     * Add reponses
     *
     * @param \Common\Bundle\LibraryBundle\Entity\Reponse $reponses
     * @return Reponse
     */
    public function addReponse(\Common\Bundle\LibraryBundle\Entity\Reponse $reponses)
    {
        $this->reponses[] = $reponses;

        return $this;
    }

    /**
     * Remove reponses
     *
     * @param \Common\Bundle\LibraryBundle\Entity\Reponse $reponses
     */
    public function removeReponse(\Common\Bundle\LibraryBundle\Entity\Reponse $reponses)
    {
        $this->reponses->removeElement($reponses);
    }

    /**
     * Get reponses
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getReponses()
    {
        return $this->reponses;
    }

     /**
     * Set qcms
     *
     * @param \Doctrine\Common\Collections\Collection $qcm
     */
    public function setQcm($qcm)
    {
        $this->qcm = $qcm;

        return $this;
    }

    /**
     * Get qcms
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getQcm()
    {
        return $this->qcm;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->reponses = new \Doctrine\Common\Collections\ArrayCollection();
    }

}
